package com.computercourse.manage_course.client;

import com.computercourse.framework.domain.cms.CmsPage;
import com.computercourse.framework.domain.cms.response.CmsPageResult;
import com.computercourse.framework.domain.course.response.CmsPostPageResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author Feng.Yuan
 * @description
 * @date 2020/1/28 11:10 下午
 * @return
 */
@FeignClient(value = "CIC-SERVICE-MANAGE-CMS") //指定远程调用的服务名
public interface CmsPageClient {
    /**
     * 根据页面id查询页面信息，远程调用cms请求数据
     */
    @GetMapping("/cms/page/get/{id}")
    CmsPage findCmsPageById(@PathVariable("id") String id);

    /**
     * 添加页面，用于课程预览
     */
    @PostMapping("/cms/page/save")
    CmsPageResult saveCmsPage(@RequestBody CmsPage cmsPage);

    /**
     * 一键发布页面
     */
    @PostMapping("/cms/page/postPageQuick")
    CmsPostPageResult postPageQuick(@RequestBody CmsPage cmsPage);
}
